package visitorPattern;

// 具体访问者类：打印访问者
public class PrintVisitor implements Visitor {
    @Override
    public void visit(TextElement textElement) {
        System.out.println("打印文本："+textElement.getText());
    }

    @Override
    public void visit(ImageElement imageElement) {
        System.out.println("打印图片："+imageElement.getImagePath());
    }
}
